package yinwei.bo.oss.receiver;

import org.springframework.amqp.rabbit.annotation.Exchange;
import org.springframework.amqp.rabbit.annotation.Queue;
import org.springframework.amqp.rabbit.annotation.QueueBinding;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import yinwei.bo.oss.MQConst.MQConst;
import yinwei.bo.oss.service.SmsService;
import yinwei.bo.oss.util.SmsProperties;

import javax.annotation.Resource;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;

public class SmsReceiver {
    @Resource
    private SmsService smsService;

    /*@RabbitListener(bindings = @QueueBinding(
            value = @Queue(value = MQConst.QUEUE_SMS_ITEM, durable = "true"),
            exchange = @Exchange(value = MQConst.EXCHANGE_TOPIC_SMS),
            key = {MQConst.ROUTING_SMS_ITEM}))
    public void send(SmsDTO smsDTO) throws IOException {
        //log.info("SmsReceiver 消息监听");
        Map<String, Object> param = new HashMap<>();
        param.put("code", smsDTO.getMessage());
        smsService.send(smsDTO.getMobile(), SmsProperties.TEMPLATE_CODE, param);
    }*/
}
